﻿using Microsoft.EntityFrameworkCore;
using Solution.Entity.Entitys;
using Solution.EntityFrameworkCore.EntityConfigMap;

namespace Solution.EntityFrameworkCore
{
    public class SolutionDbContext : DbContext
    {
        public SolutionDbContext(DbContextOptions<SolutionDbContext> options) : base(options)
        {
        }

        public DbSet<SysUser>  sysUsers { get; set; }
        public DbSet<Department> Departments { get; set; }
        public DbSet<Employee>  Employees { get; set; }

        public DbSet<EmpRoleRelation> empRoleRelations { get; set; }

        public DbSet<Permission> permissions { get; set; }

        public DbSet<Role> roles { get; set; }

        public DbSet<RolePerRelationship> RolePerRelationships { get; set; }

        public DbSet<VipPermssion> vipPermssions { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new SysUserMap());

            //modelBuilder.Entity<SysOrder>().ToTable("Sys_Order");

            base.OnModelCreating(modelBuilder);
        }
    }
}